package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BottleMapper;
import com.ruoyi.system.domain.Bottle;
import com.ruoyi.system.service.IBottleService;

/**
 * 漂流瓶Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-27
 */
@Service
public class BottleServiceImpl implements IBottleService 
{
    @Autowired
    private BottleMapper bottleMapper;

    /**
     * 查询漂流瓶
     * 
     * @param id 漂流瓶主键
     * @return 漂流瓶
     */
    @Override
    public Bottle selectBottleById(Long id)
    {
        return bottleMapper.selectBottleById(id);
    }

    /**
     * 查询漂流瓶列表
     * 
     * @param bottle 漂流瓶
     * @return 漂流瓶
     */
    @Override
    public List<Bottle> selectBottleList(Bottle bottle)
    {
        return bottleMapper.selectBottleList(bottle);
    }

    /**
     * 新增漂流瓶
     * 
     * @param bottle 漂流瓶
     * @return 结果
     */
    @Override
    public int insertBottle(Bottle bottle)
    {
        bottle.setCreateTime(DateUtils.getNowDate());
        return bottleMapper.insertBottle(bottle);
    }

    /**
     * 修改漂流瓶
     * 
     * @param bottle 漂流瓶
     * @return 结果
     */
    @Override
    public int updateBottle(Bottle bottle)
    {
        return bottleMapper.updateBottle(bottle);
    }

    /**
     * 批量删除漂流瓶
     * 
     * @param ids 需要删除的漂流瓶主键
     * @return 结果
     */
    @Override
    public int deleteBottleByIds(Long[] ids)
    {
        return bottleMapper.deleteBottleByIds(ids);
    }

    /**
     * 删除漂流瓶信息
     * 
     * @param id 漂流瓶主键
     * @return 结果
     */
    @Override
    public int deleteBottleById(Long id)
    {
        return bottleMapper.deleteBottleById(id);
    }
}
